package com.juanpi.mkt.ruleengine.item;

import java.util.ArrayList;
import java.util.Date;

public class Fact {
	
	
	private double totalAmount=0;
	private int totalCounts=0;
	private User user;
	private Date time;
	private ArrayList<Goods> cartGoods=new ArrayList<Goods>();
	
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}


	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(int totalAmount) {
		this.totalAmount = totalAmount;
	}

	public int getTotalCounts() {
		return totalCounts;
	}

	public void setTotalCounts(int totalCounts) {
		this.totalCounts = totalCounts;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public ArrayList<Goods> getGoods() {
		return cartGoods;
	}

	public void setGoods(ArrayList<Goods> goods) {
		cartGoods = goods;
	}
	
	public void addGoods(Goods goods)
	{
		cartGoods.add(goods);
		totalAmount=totalAmount+goods.getPrice();
		totalCounts++;
	}
	
	
	
	
	

}
